<?php

namespace app\common\model;
use think\Model;

class AdminUser extends model {
    //开启时间戳自动写入
    protected  $autoWriteTimestamp = true;
	//新增用户
	public function add($data)
	{
		if(!is_array($data)){
		    exception("数据不合法");
        }
        //allowField严格校验传递的字段
	    $this->allowField(true)->save($data);
		//返回自增id
		return $this->id;
	}
}